#!/usr/bin/env python
# coding: utf-8

from google.appengine.ext import db

class GPLaunching():
    title = ""
    product_key = ""
    

class Products(db.Model):
    title = db.StringProperty()
    link = db.StringProperty(indexed=False)
    time_start = db.DateTimeProperty()
    time_end = db.DateTimeProperty()
    latest_update = db.DateTimeProperty()
    price_original = db.IntegerProperty(indexed=False)
    price_now = db.IntegerProperty(indexed=False)
    sale_percent = db.IntegerProperty(indexed=False)
    photo_url = db.StringProperty(indexed=False)
    area = db.StringProperty()
    type = db.StringProperty()
    category = db.StringProperty()
    social_provider = db.StringProperty(indexed=False)
    social_provider_code = db.IntegerProperty()
    is_expired = db.IntegerProperty()               # 0 - Available, 1-Expired
    keywords = db.StringListProperty()
    sell_list = db.ListProperty(int)
    sell_delta = db.IntegerProperty() 
    # latitude = db.StringProperty()
    # longigute = db.StringProperty()

    
class Users(db.Model):
    loginid = db.StringProperty()
    email = db.EmailProperty()
    deposit = db.IntegerProperty(indexed=False)
    deposit_gp = db.StringListProperty()
    nondeposit_gp = db.StringListProperty()
    
    
# image
# http://code.google.com/intl/ko-KR/appengine/docs/python/images/usingimages.html
# http://code.google.com/intl/ko-KR/appengine/articles/python/serving_dynamic_images.html
class GroupPurchase(db.Model):
    title = db.StringProperty()
    photo_url = db.StringProperty(indexed=False)
    trigger_userid = db.StringProperty()
    lprice = db.IntegerProperty()
    description = db.StringProperty(indexed=False)
    time_start = db.DateTimeProperty()
    time_end = db.DateTimeProperty()
    extend_count = db.IntegerProperty(indexed=False)
    deposit_userid_list = db.StringListProperty(indexed=False)
    deposit_userid_count = db.IntegerProperty()
    nondeposit_userid_list = db.StringListProperty(indexed=False)
    nondeposit_userid_count = db.IntegerProperty()
    is_expired = db.IntegerProperty()               # 0 - Available, 1-Expired
    product_key = db.StringProperty()
    